<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>全屏渐入循环文字</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        html, body {
            width: 100vw;
            height: 100vh;
            overflow: hidden;
        }
        .text-container {
            width: 100%;
            height: 100%;
            background-color: #ff0000;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .target-text {
            color: #ffffff;
            font-size: 8vw;
            font-weight: 700;
            text-align: center;
            padding: 20px;
            /* 新增渐入+循环效果：从透明到不透明，再保持不透明，3秒一个周期 */
            animation: fadeInLoop 3s infinite ease-in-out;
        }
        /* 定义渐入循环动画，0%完全透明，30%到100%保持不透明，实现循环渐入 */
        @keyframes fadeInLoop {
            0% { opacity: 0; }
            30% { opacity: 1; }
            100% { opacity: 1; }
        }
    </style>
</head>
<body>
    <div class="text-container">
        <div class="target-text">白主客真是诱人</div>
    </div>
    <script>
        window.addEventListener('resize', function() {
            const container = document.querySelector('.text-container');
            container.style.height = window.innerHeight + 'px';
            container.style.width = window.innerWidth + 'px';
        });
    </script>
</body>
</html>

